package com.pmon.pacgravity;

import java.util.ArrayList;

public class Maze {

	private int mazeMaxRow, mazeMaxColumn; //by grids
	private int ghostSpawnLocX, ghostSpawnLocY;
	
	// 0 = wall, 1 = food, 2 = power, 3 = ghost door, 5 = blank, 6 = ghost
	private int maze1[][] = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},  //row 1
			{0,1,1,1,1,0,1,1,1,0,1,1,1,1,0},
			{0,2,0,0,1,0,1,0,1,0,1,0,0,2,0},
			{5,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
			{0,0,1,0,0,0,0,1,0,0,0,0,1,0,0},  
			{0,0,1,1,1,1,1,2,1,1,1,1,1,0,0},  //row 6
			{0,0,1,0,0,1,0,0,0,1,0,0,1,0,0},
			{0,1,1,5,5,5,5,5,5,5,5,5,1,1,0},
			{0,1,0,0,5,0,0,0,0,0,5,0,0,1,0},
			{0,1,0,0,5,0,6,6,6,0,5,0,0,1,0},  //row 10, monster cage
			{0,1,0,0,5,0,0,3,0,0,5,0,0,1,0},
			{0,1,1,5,5,5,5,5,5,5,5,5,1,1,0},  // door step
			{0,0,1,0,0,1,0,5,0,1,0,0,1,0,0},
			{0,0,1,1,1,1,1,2,1,1,1,1,1,0,0}, //row 14
			{0,0,1,0,0,0,0,1,0,0,0,0,1,0,0},
			{0,0,1,0,1,1,1,1,1,1,1,0,1,0,0},
			{5,1,1,1,1,0,0,1,0,0,1,1,1,1,5},
			{0,1,0,0,0,0,0,1,0,0,0,0,0,1,0},
			{0,1,1,1,1,1,1,1,1,1,1,1,1,1,0},
			{0,2,0,0,1,0,1,0,1,0,1,0,0,2,0},
			{0,1,1,1,1,0,1,1,1,0,1,1,1,1,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
		};
	
	private int directionMaze1[][] = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // row 1
			{0,1,0,0,2,0,1,0,2,0,1,0,0,2,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,3,7,0,8,0,8,7,8,0,8,0,7,4,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},  
			{0,0,5,0,0,7,0,8,0,7,0,0,6,0,0}, // row 6
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,1,8,0,7,8,0,0,0,8,7,0,8,2,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //row 10, ghost cage
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,3,7,0,8,7,0,7,0,7,8,0,7,4,0}, //monster door step, row 12
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,5,0,0,8,0,7,0,8,0,0,6,0,0}, // row 14
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,9,0,0,2,0,0,0,0},
			{0,1,8,0,4,0,0,0,0,0,3,0,8,2,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,5,0,0,7,0,7,8,7,0,7,0,0,6,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,3,0,0,4,0,3,0,4,0,3,0,0,4,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	};
	
	private int maze2[][] = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // row 1
			{0,1,1,1,1,0,1,1,1,0,1,1,1,1,0}, // row 2
			{0,1,0,0,1,1,1,0,1,1,1,0,0,1,0},
			{0,1,1,0,1,0,1,2,1,0,1,0,1,1,0}, // row 4
			{0,0,1,0,1,0,0,0,0,0,1,0,1,0,0},
			{0,1,1,0,1,1,1,1,1,1,1,0,1,1,0},
			{0,1,0,0,1,0,0,0,0,0,1,0,0,1,0}, // row 7
			{5,1,1,1,1,1,1,2,1,1,1,1,1,1,5},
			{0,1,0,0,5,0,0,0,0,0,5,0,0,1,0},
			{0,1,0,0,5,0,6,6,6,0,5,0,0,1,0}, // row 10
			{0,1,0,0,5,0,0,3,0,0,5,0,0,1,0},
			{0,1,5,5,5,5,5,5,5,5,5,5,5,1,0},
			{0,1,0,5,0,5,0,5,0,5,0,5,0,1,0},
			{0,1,0,5,0,5,5,5,5,5,0,5,0,1,0}, // row 14
			{5,1,1,2,0,1,0,0,0,1,0,2,1,1,5},
			{0,1,0,1,0,1,0,0,0,1,0,1,0,1,0},
			{0,1,1,1,0,1,0,0,0,1,0,1,1,1,0},
			{0,1,0,1,1,1,0,0,0,1,1,1,0,1,0},
			{0,1,0,1,0,1,1,2,1,1,0,1,0,1,0}, // row 19
			{0,1,0,1,0,0,1,0,1,0,0,1,0,1,0},
			{0,1,1,1,1,1,1,1,1,1,1,1,1,1,0},						
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		};
	
	private int directionMaze2[][] = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // row 1
			{0,1,0,0,2,0,1,0,2,0,1,0,0,2,0},
			{0,0,0,0,5,0,6,0,5,0,6,0,0,0,0},
			{0,3,2,0,0,0,3,0,4,0,0,0,1,4,0}, // row 4
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},  
			{0,1,4,0,5,0,0,0,0,0,6,0,3,2,0}, // row 6
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,5,0,0,9,0,0,0,0,0,9,0,0,6,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //row 10, ghost cage
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,5,0,1,8,7,0,7,0,7,8,2,0,6,0}, //monster door step, row 12
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,5,0,8,0,6,0,0,0,0,0}, // row 14
			{0,5,0,6,0,0,0,0,0,0,0,5,0,6,0},
			{0,0,0,0,1,0,0,9,0,0,2,0,0,0,0},
			{0,5,0,6,0,0,0,0,0,0,0,5,0,6,0}, // row 17
			{0,0,0,5,0,6,0,0,0,5,0,6,0,0,0},
			{0,0,0,0,0,3,7,0,7,4,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // row 20
			{0,3,0,8,0,0,8,0,8,0,0,8,0,4,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	};
	
	private int maze3[][] = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},  //row 1
	        {5,1,1,1,1,0,0,0,0,0,1,1,1,1,5},
	        {0,0,1,0,1,0,1,1,1,0,1,0,1,0,0},
	        {0,0,1,1,1,1,1,0,1,1,1,1,1,0,0},
	        {0,0,1,0,0,0,1,2,1,0,0,0,1,0,0}, 
	        {0,1,1,1,1,1,1,0,1,1,1,1,1,1,0},  //row 6
	        {0,1,0,0,0,1,0,0,0,1,0,0,0,1,0},
	        {0,1,1,5,5,5,5,2,5,5,5,5,1,1,0},  //row 8
	        {0,1,0,0,5,0,0,0,0,0,5,0,0,1,0},
	        {0,1,0,0,5,0,6,6,6,0,5,0,0,1,0},  //row 10 monster cage
	        {0,1,0,0,5,0,0,3,0,0,5,0,0,1,0},
	        {0,1,1,5,5,5,5,5,5,5,5,5,1,1,0},  // door step
	        {0,0,1,0,0,1,0,5,0,1,0,0,1,0,0},
	        {0,0,1,1,1,1,1,2,1,1,1,1,1,0,0},  //row 14
	        {0,0,1,0,0,0,0,1,0,0,0,0,1,0,0},
	        {0,0,1,0,1,1,1,1,1,1,1,0,1,0,0},  // row 16
	        {5,1,1,1,1,0,1,0,1,0,1,1,1,1,5},
	        {0,1,0,0,0,0,1,0,1,0,0,0,0,1,0},  // row 18
	        {0,1,1,1,1,1,1,0,1,1,1,1,1,1,0},
	        {0,0,1,0,1,0,1,2,1,0,1,0,1,0,0},  // row 20
	        {5,1,1,1,1,0,0,0,0,0,1,1,1,1,5},
	        {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	};
	
	private int directionMaze3[][] = {
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // row 1
			{0,0,1,0,2,0,0,0,0,0,1,0,2,0,0},
			{0,0,0,0,0,0,1,0,2,0,0,0,0,0,0},  
			{0,0,5,0,8,0,6,0,5,0,8,0,6,0,0},
			{0,0,0,0,0,0,5,0,6,0,0,0,0,0,0},  
			{0,1,0,0,0,7,4,0,3,7,0,0,0,2,0}, // row 6
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,5,0,0,7,8,0,0,0,8,7,0,0,6,0}, // row 8
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //row 10 ghost cage
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,3,7,0,8,7,0,7,0,7,8,0,7,4,0}, // monster door step row 12
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,5,0,0,8,0,7,0,8,0,0,6,0,0}, // row 14
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,7,8,7,0,2,0,0,0,0}, // row 16
			{0,1,8,0,4,0,0,0,0,0,3,0,8,2,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // row 18
			{0,3,7,0,7,0,6,0,5,0,7,0,7,4,0},
			{0,0,0,0,0,0,3,0,4,0,0,0,0,0,0}, // row 20
			{0,0,3,0,4,0,0,0,0,0,3,0,4,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	};
	
	
	private int maze4[][] = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},  //row 1
			{0,1,1,1,0,1,1,2,1,1,0,1,1,1,0},
	        {0,2,0,1,0,1,0,0,0,1,0,1,0,2,0},
	        {5,1,1,1,0,1,1,1,1,1,0,1,1,1,5},
	        {0,1,0,1,0,1,0,0,0,1,0,1,0,1,0}, 
	        {0,1,0,1,0,1,1,1,1,1,0,1,0,1,0},  //row 6
	        {0,1,1,1,0,0,0,1,0,0,0,1,1,1,0},
	        {0,1,0,1,5,5,5,5,5,5,5,5,5,1,0},  //row 8
	        {0,1,0,0,1,0,0,0,0,0,1,0,0,1,0},
	        {0,1,1,1,1,0,6,6,6,0,1,1,1,1,0},  //row 10 monster cage
	        {5,1,0,0,1,0,0,3,0,0,1,0,0,1,5},
	        {0,1,0,0,1,5,5,5,5,5,1,0,0,1,0},  // door step
	        {0,1,1,5,5,5,0,5,0,5,5,5,1,1,0},
	        {0,1,0,0,0,5,0,5,0,5,0,0,0,1,0},  //row 14
	        {0,1,1,5,5,5,5,5,5,5,5,5,1,1,0},
	        {0,1,0,1,0,0,0,1,0,0,0,1,0,1,0},  // row 16
	        {0,1,1,1,0,1,1,1,1,1,0,1,1,1,0},
	        {0,1,0,1,0,1,0,0,0,1,0,1,0,1,0},  // row 18
	        {5,2,0,1,0,1,1,1,1,1,0,1,0,2,5},
	        {0,1,0,1,0,1,0,0,0,1,0,1,0,1,0},  // row 20
	        {0,1,1,1,0,1,1,2,1,1,0,1,1,1,0},
	        {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	};
	
	private int directionMaze4[][] = {
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // row 1
		   	{0,1,0,2,0,1,0,0,0,2,0,1,0,2,0}, //2
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //3
		   	{0,5,0,6,0,5,0,0,0,6,0,5,0,6,0}, //4
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //5
		   	{0,0,0,0,0,3,0,7,0,4,0,0,0,0,0},
		   	{0,5,0,6,0,0,0,0,0,0,0,0,5,0,6}, //7
		   	{0,0,0,3,7,0,0,8,0,0,7,4,0,0,0},
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //9
		   	{0,5,0,0,2,0,0,0,0,0,1,0,0,6,0},
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //11
		   	{0,0,0,0,5,7,0,7,0,7,6,0,0,0,0},
		   	{0,5,0,0,8,6,0,0,0,5,8,0,0,6,0}, //13
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		   	{0,5,0,7,0,8,0,9,0,8,0,7,0,6,0}, //15
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		   	{0,5,0,6,0,1,0,8,0,2,0,5,0,6,0}, //17
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		   	{0,0,0,0,0,5,0,0,0,6,0,0,0,0,0}, //19
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		   	{0,3,0,4,0,3,0,0,0,4,0,3,0,4,0}, //21
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	};
	
	private int maze5[][] = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},  //row 1
			{0,1,1,1,2,0,1,1,1,0,2,1,1,1,0},
	        {0,1,0,0,1,0,1,0,1,0,1,0,0,1,0},
	        {0,1,1,1,1,0,1,0,1,0,1,1,1,1,0},
	        {0,0,0,0,1,0,1,1,1,0,1,0,0,0,0}, 
	        {0,1,1,0,1,0,1,0,1,0,1,0,1,1,0},  //row 6
	        {0,1,1,5,5,0,1,0,1,0,1,5,1,1,0},
	        {0,1,1,0,5,0,1,1,1,1,1,0,1,1,0},  //row 8
	        {0,1,1,0,5,0,0,0,0,0,5,0,1,1,0},
	        {5,1,1,0,5,0,5,5,5,0,5,0,1,1,5},  //row 10 monster cage
	        {0,1,2,0,5,0,0,3,0,0,5,0,2,1,0},
	        {0,1,1,0,5,5,5,5,5,5,5,0,1,1,0},  // door step
	        {0,1,1,0,5,0,0,5,0,0,5,0,1,1,0},
	        {0,1,1,5,5,5,5,5,5,5,5,5,1,1,0},  //row 14
	        {0,1,1,0,5,0,0,0,0,0,1,0,1,1,0},
	        {0,1,1,0,5,5,1,1,1,0,1,0,1,1,0},  // row 16
	        {0,1,1,0,5,0,1,0,1,0,1,0,1,1,0},
	        {0,0,0,0,5,0,1,0,1,0,1,0,0,0,0},  // row 18
	        {0,1,1,1,1,0,1,1,1,0,1,1,1,1,0},
	        {0,1,0,0,1,0,1,0,1,0,1,0,0,1,0},  // row 20
	        {0,2,1,1,1,0,1,1,1,0,1,1,1,2,0},
	        {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	};
	
	private int directionMaze5[][] = {
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // row 1
		   	{0,1,0,0,2,0,1,0,2,0,1,0,0,2,0}, //2
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //3
		   	{0,3,0,0,6,0,0,0,0,0,5,0,0,4,0}, //4
		   	{0,0,0,0,0,0,5,0,6,0,0,0,0,0,0}, //5
		   	{0,1,2,0,0,0,0,0,0,0,0,0,1,2,0},
		   	{0,5,6,0,6,0,0,0,0,0,5,0,5,6,0}, //7
		   	{0,5,6,0,0,0,3,0,3,0,6,0,5,6,0},
		   	{0,5,6,0,0,0,0,0,0,0,0,0,5,6,0}, //9
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		   	{0,5,6,0,0,0,0,0,0,0,0,0,5,6,0}, //11
		   	{0,0,0,0,5,0,0,7,0,0,6,0,0,0,0},
		   	{0,5,6,0,0,0,0,0,0,0,0,0,5,6,0}, //13
		   	{0,5,9,0,9,0,0,8,0,0,0,0,9,6,0},
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //15
		   	{0,5,6,0,5,0,7,0,2,0,0,0,5,6,0},
		   	{0,3,4,0,0,0,0,0,0,0,0,0,3,4,0}, //17
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		   	{0,1,0,0,6,0,5,0,6,0,5,0,0,2,0}, //19
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		   	{0,3,0,0,4,0,3,0,4,0,3,0,0,4,0}, //21
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	};
	
  // t1[0]= 0;
  // t1[1]= 9; // rd (right and down)
  // t1[2]=10; // ld
  // t1[3]= 5; // ru
  // t1[4]= 6; // lu
  // t1[5]=13; // rdu
  // t1[6]=14; // ldu
  // t1[7]=11; // rld
  // t1[8]= 7; // rlu
  // t1[9]=15; // rlud
	

/*	
	private int t2[][] = {
			1];
		    t2[2]= [2];
		    t2[4]= [4];
		    t2[8]= [8];
		    t2[3]= [1, 2];
		    t2[9]= [1, 8];
		    t2[10]=[2, 8];
		    t2[12]=[4, 8];
		    t2[5]= [1, 4];
		    t2[6]= [2, 4];
		    t2[7]= [1, 2, 4];
		    t2[11]=[1, 2, 8];
		    t2[13]=[1, 4, 8];
		    t2[14]=[2, 4, 8];
		    t2[15]=[1, 2, 4, 8];;
	}
*/
	
	private ArrayList<Integer> bitVectorArray[] = new ArrayList[16];
	private int foodCount = 125;
	
	//constructor
	public Maze() {
		mazeMaxRow = 22;
		mazeMaxColumn = 15;
		initArray();
		ghostSpawnLocX = 7;
		ghostSpawnLocY = 10;
	}

	public int[][] getMaze(int i) {
		if (i == 1) return maze1;
		if (i == 2) return maze2;
		if (i == 3) return maze3;
		if (i == 4) return maze4;
		if ( i== 5) return maze5;
		return null;
	}
	
	public int getMazeRow(){
		return mazeMaxRow;
	}
	
	public int getMazeColumn(){
		return mazeMaxColumn;
	}
	
	public int getFoodCount(){
		return foodCount;
	}
	
	public void clearFood(int x, int y){
		maze1[x][y] = 5;
	}
	
	public int[][] getDirectionMaze(int i){
		if (i == 1) return directionMaze1;
		if (i == 2) return directionMaze2;
		if (i == 3) return directionMaze3;
		if (i == 4) return directionMaze4;
		if (i==5) return directionMaze5;
		return null;
	}
	
	public ArrayList<Integer>[] getGhostArray(){
		return bitVectorArray;
	}
	
	
	//init the array for directions
	private void initArray(){
		for (int i = 0; i < 16; i++){
			bitVectorArray[i] = new ArrayList<Integer>();
		}
		
		bitVectorArray[1].add(1);
	    bitVectorArray[4].add(4);
	    bitVectorArray[8].add(8);
	    bitVectorArray[3].add(1); bitVectorArray[3].add(2);
	    bitVectorArray[9].add(1); bitVectorArray[9].add(8);
	    bitVectorArray[10].add(2); bitVectorArray[10].add(8);
	    bitVectorArray[12].add(4); bitVectorArray[12].add(8);
	    bitVectorArray[5].add(1); bitVectorArray[5].add(4);
	    bitVectorArray[6].add(2); bitVectorArray[6].add(4);
	    
	    bitVectorArray[7].add(1); bitVectorArray[7].add(2); bitVectorArray[7].add(4);
	    bitVectorArray[11].add(1); bitVectorArray[11].add(2); bitVectorArray[11].add(8);
	    bitVectorArray[13].add(1); bitVectorArray[13].add(4); bitVectorArray[13].add(8);
	    bitVectorArray[14].add(2); bitVectorArray[14].add(4); bitVectorArray[14].add(8);
	    
	    bitVectorArray[15].add(1); bitVectorArray[15].add(2); bitVectorArray[15].add(4); bitVectorArray[15].add(8);
	}

	public int getGhostSpawnLocX() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getGhostSpawnLocY() {
		// TODO Auto-generated method stub
		return 0;
	}
}



/* Maze layout
		
		
		maze 2
			{"WWWWWWWWWWWWWWW"}, // row 1
			{"W....W...W....W"}, // row 2
			{"W.WW...W...WW.W"},
			{"W..W.W...W.W..W"}, // row 4
			{"WW.W.WWWWW.W.WW"},
			{"W..W.......W..W"},
			{"W.WW.WWWWW.WW.W"}, // row 7
			{"W.............W"},
			{"W.WW-WWWWW-WW.W"},
			{"W.WW-WGGGW-WW.W"}, // row 10
			{"W.WW-WWDWW-WW.W"},
			{"W.-----------.W"},
			{"W.W.W.W-W.W.W.W"},
			{"W.W.W.---.W.W.W"}, // row 14
			{"W...W.WWW.w...W"},
			{"W.W.W.WWW.W.W.W"},
			{"W...W.WWW.W...W"},
			{"W.W...WWW...W.W"},
			{"W.W.W.....W.W.W"}, // row 19
			{"W.W.WW.W.WW.W.W"},
			{"W.............W"},						
			{"WWWWWWWWWWWWWWW"},
			
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,3,7,0,8,0,8,7,8,0,8,0,7,4,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},  
			{0,0,5,0,0,7,0,8,0,7,0,0,6,0,0}, // row 6
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,1,8,0,7,8,0,0,0,8,7,0,8,2,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, //row 10, ghost cage
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,3,7,0,8,7,0,7,0,7,8,0,7,4,0}, //monster door step, row 12
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,5,0,0,8,0,7,0,8,0,0,6,0,0}, // row 14
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,9,0,0,2,0,0,0,0},
			{0,1,8,0,4,0,0,0,0,0,3,0,8,2,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,5,0,0,7,0,7,8,7,0,7,0,0,6,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,3,0,0,4,0,3,0,4,0,3,0,0,4,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
		
		
		{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
		{0,1,1,1,1,0,1,1,1,0,1,1,1,1,0},
		{0,2,0,0,1,0,0,1,0,0,1,0,0,2,0},
		{0,1,1,1,1,1,1,1,1,1,1,1,1,1,0},
		{0,0,1,0,0,0,0,1,0,0,0,0,1,0,0},
		{0,0,1,0,0,0,0,1,0,0,0,0,1,0,0},
		{0,0,1,1,1,1,1,2,1,1,1,1,1,0,0},
		{0,0,1,0,0,1,0,0,0,1,0,0,1,0,0},
		{0,1,1,5,5,5,5,5,5,5,5,5,1,1,0},
		{0,1,0,0,5,0,0,3,0,0,5,0,0,1,0},
		{0,1,0,0,5,0,6,6,6,0,5,0,0,1,0},
		{0,1,0,0,5,0,0,0,0,0,5,0,0,1,0},
		{0,1,1,5,5,5,5,5,5,5,5,5,1,1,0},
		{0,0,1,0,0,1,0,0,0,1,0,0,1,0,0},
		{0,0,1,1,1,1,1,2,1,1,1,1,1,0,0},
		{0,0,1,0,0,0,0,1,0,0,0,0,1,0,0},
		{0,0,1,0,1,1,1,1,1,1,1,0,1,0,0},
		{0,1,1,1,1,0,0,1,0,0,1,1,1,1,0},
		{0,1,0,0,0,0,0,1,0,0,0,0,0,1,0},
		{0,1,1,1,1,1,1,1,1,1,1,1,1,1,0},
		{0,2,0,0,1,0,0,1,0,0,1,0,0,2,0},
		{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
		
		
		
		
		maze 3
		   {WWWWWWWWWWWWWWW}  //row 1
           {-....WWWWW....-}
           {WW.W.W...W.W.WW}
           {WW.....W.....WW}
           {WW.WWW.o.WWW.WW}  
           {W......W......W}  //row 6
           {W.WWW.WWW.WWW.W}
           {W..----o----..W}  //row 8
           {W.WW-WWWWW-WW.W}
           {W.WW-W666W-WW.W}  //row 10 monster cage
           {W.WW-WW3WW-WW.W}
           {W..---------..W}  // door step
           {WW.WW.W-W.WW.WW}
           {WW.....o.....WW}  //row 14
           {WW.WWWW.WWWW.WW}
           {WW.W.......W.WW}  // row 16
           {-....W.W.W....-}
           {W.WWWW.W.WWWW.W}  // row 18
           {W......W......W}
           {WW.W.W.o.W.W.WW}  // row 20
           {-....WWWWW....-}
           {WWWWWWWWWWWWWWW}
		   
		   
		   	{000000000000000} // row 1
			{001020000010200}
			{000000102000000}   
			{005080605080600}
			{000000506000000}  
			{010007403700020} // row 6
			{000000000000000}
			{050078000870060} // row 8
			{000000000000000}
			{000000000000000} //row 10 ghost cage
			{000000000000000}
			{037087070780740} //monster door step row 12
			{000000000000000}
			{005008070800600} // row 14
			{000000000000000}
			{000010787020000} // row 16
			{018040000030820}
			{000000000000000} // row 18
			{037070605070740}
			{000000304000000} // row 20
			{003040000030400}
			{000000000000000}
		
		   {W,W,W,W,W,W,W,W,W,W,W,W,W,W,W}  //row 1
           {-,.,.,.,.,W,W,W,W,W,.,.,.,.,-}
           {W,W,.,W,.,W,.,.,.,W,.,W,.,W,W}
           {W,W,.,.,.,.,.,W,.,.,.,.,.,W,W}
           {W,W,.,W,W,W,.,o,.,W,W,W,.,W,W}  
           {W,.,.,.,.,.,.,W,.,.,.,.,.,.,W}  //row 6
           {W,.,W,W,W,.,W,W,W,.,W,W,W,.,W}
           {W,.,.,-,-,-,-,o,-,-,-,-,.,.,W}  //row 8
           {W,.,W,W,-,W,W,W,W,W,-,W,W,.,W}
           {W,.,W,W,-,W,6,6,6,W,-,W,W,.,W}  //row 10 monster cage
           {W,.,W,W,-,W,W,3,W,W,-,W,W,.,W}
           {W,.,.,-,-,-,-,-,-,-,-,-,.,.,W}  // door step
           {W,W,.,W,W,.,W,-,W,.,W,W,.,W,W}
           {W,W,.,.,.,.,.,o,.,.,.,.,.,W,W}  //row 14
           {W,W,.,W,W,W,W,.,W,W,W,W,.,W,W}
           {W,W,.,W,.,.,.,.,.,.,.,W,.,W,W}  // row 16
           {-,.,.,.,.,W,.,W,.,W,.,.,.,.,-}
           {W,.,W,W,W,W,.,W,.,W,W,W,W,.,W}  // row 18
           {W,.,.,.,.,.,.,W,.,.,.,.,.,.,W}
           {W,W,.,W,.,W,.,o,.,W,.,W,.,W,W}  // row 20
           {-,.,.,.,.,W,W,W,W,W,.,.,.,.,-}
           {W,W,W,W,W,W,W,W,W,W,W,W,W,W,W}
		   
		   
		   	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} // row 1
			{0,0,1,0,2,0,0,0,0,0,1,0,2,0,0}
			{0,0,0,0,0,0,1,0,2,0,0,0,0,0,0}   
			{0,0,5,0,8,0,6,0,5,0,8,0,6,0,0}
			{0,0,0,0,0,0,5,0,6,0,0,0,0,0,0}  
			{0,1,0,0,0,7,4,0,3,7,0,0,0,2,0} // row 6
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
			{0,5,0,0,7,8,0,0,0,8,7,0,0,6,0} // row 8
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} //row 10 ghost cage
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
			{0,3,7,0,8,7,0,7,0,7,8,0,7,4,0} //monster door step row 12
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
			{0,0,5,0,0,8,0,7,0,8,0,0,6,0,0} // row 14
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
			{0,0,0,0,1,0,7,8,7,0,2,0,0,0,0} // row 16
			{0,1,8,0,4,0,0,0,0,0,3,0,8,2,0}
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} // row 18
			{0,3,7,0,7,0,6,0,5,0,7,0,7,4,0}
			{0,0,0,0,0,0,3,0,4,0,0,0,0,0,0} // row 20
			{0,0,3,0,4,0,0,0,0,0,3,0,4,0,0}
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
		
		
		
*/

